<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>系统登录</title>
<%@include file="/jsp/common/inc.jsp"%>
<script type="text/javascript">
	var login;
	$(function() {
		login = $("#login").dialog({
			closed : false,
			cache : false,
			modal : true,
			closable : false,
			buttons : [ {
				text : '登录',
				handler : function() {
					if ($("#loginForm").form("validate")) {
						$("#loginForm").submit();
					}
				}
			}, {
				text : "重置",
				handler : function() {
					$("#username").val("");
					$("#password").val("");
				}
			} ]
		});
		// 校验用户名密码
		$("#username").validatebox({
			required : true,
			missingMessage : "请输入用户名"
		});
		$("#password").validatebox({
			required : true,
			missingMessage : "请输入密码"
		})
		$("#errmsg").css("color", "#f00");
		
		//回车事件
		$("#loginForm").keyup(function(event){
			if(event.keyCode == 13){
				if ($("#loginForm").form("validate")) {
					$("#loginForm").submit();
				}
			}
		})
	});
</script>
</head>
<body>
	<div id="login" title="登录" style="width: 260px; height: 160px;">
		<form id="loginForm" method="post" action="login">
			<table class="tableForm">
				<tr>
					<th align="right">登录名：</th>
					<td><input id="username" name="username" value="" /></td>
				</tr>
				<tr>
					<th align="right">密码：</th>
					<td><input id="password" name="password" type="password"
						value="" /></td>
				</tr>
				<tr>
					<td colspan="2" id="errmsg">${message }</td>
				</tr>
			</table>
		</form>
	</div>

</body>
</html>